//
//  YZMStockSellNoneCell.m
//  YZMicroStock
//
//  Created by Lv.Dongdong on 16/11/7.
//  Copyright © 2016年 cqjr. All rights reserved.
//

#import "YZMStockSellNoneCell.h"

@interface YZMStockSellNoneCell()

@property (nonatomic, strong) UIButton *addBT;

@end

@implementation YZMStockSellNoneCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createObjects];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
    }
    return self;
}

- (void)addButtonPressed:(UIButton *)sender{
    
    if (self.addAction) {
        
        self.addAction();
    }
}

- (void)createObjects{
    
    self.addBT  = [UIButton new];
    [self.addBT setImage:[UIImage imageNamed:@"icon_stock_add_gray"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.addBT];
    [self.addBT addTarget:self action:@selector(addButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
    [self.addBT mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView).offset(-30);
    }];
    
    UILabel *label = [YZMAppStyle labelWithLargeWhite];
    label.text = @"暂无数据，立即发起点买";
    [self.contentView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.addBT.mas_bottom).offset(15);
    }];
}

@end
